<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>simvoc.core.common_reader.CommonReader</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="simvoc-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            >SimVOC</th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="simvoc-module.html">Package&nbsp;simvoc</a> ::
        <a href="simvoc.core-module.html">Package&nbsp;core</a> ::
        <a href="simvoc.core.common_reader-module.html">Module&nbsp;common_reader</a> ::
        Class&nbsp;CommonReader
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<!-- ==================== CLASS DESCRIPTION ==================== -->
<h1 class="epydoc">Class CommonReader</h1><p class="nomargin-top"><span class="codelink"><a href="simvoc.core.common_reader-pysrc.html#CommonReader">source&nbsp;code</a></span></p>
<center>
<center>  <map id="uml_class_diagram_for_simvoc_c_6" name="uml_class_diagram_for_simvoc_c_6">
<area shape="rect" id="node9" href="simvoc.core.common_reader.CommonReader-class.html#__init__" title="x.__init__(...) initializes x; see x.__class__.__doc__ for signature" alt="" coords="203,39,500,57"/>
<area shape="rect" id="node9" href="simvoc.core.common_reader.CommonReader-class.html#add_handler" title="Adds a parse handler to support new commands." alt="" coords="203,57,500,76"/>
<area shape="rect" id="node9" href="simvoc.core.common_reader.CommonReader-class.html#add_trigger" title="Adds a new parse trigger as a simulator event scheduled for a time not in &#160;the past." alt="" coords="203,76,500,95"/>
<area shape="rect" id="node9" href="simvoc.core.common_reader.CommonReader-class.html#error" title="Uniform mechanism for producing error messages (ReaderExceptions) with &#160;filename and line number information." alt="" coords="203,95,500,113"/>
<area shape="rect" id="node9" href="simvoc.core.common_reader.CommonReader-class.html#get_epoch" title="Returns: &#160;epoch value found in the input file (defaults to zero if not present)" alt="" coords="203,113,500,132"/>
<area shape="rect" id="node9" href="simvoc.core.common_reader.CommonReader-class.html#h_clock" title="Parse handler for clock lines." alt="" coords="203,132,500,151"/>
<area shape="rect" id="node9" href="simvoc.core.common_reader.CommonReader-class.html#h_epoch" title="Parse handler for the epoch statement, which allows multiple input files &#160;with normalized times to be used in the same simulation." alt="" coords="203,151,500,169"/>
<area shape="rect" id="node9" href="simvoc.core.common_reader.CommonReader-class.html#h_format" title="Parse handler for the &quot;format&quot; command." alt="" coords="203,169,500,188"/>
<area shape="rect" id="node9" href="simvoc.core.common_reader.CommonReader-class.html#h_meta" title="Parse handler for metadata." alt="" coords="203,188,500,207"/>
<area shape="rect" id="node9" href="simvoc.core.common_reader.CommonReader-class.html#h_version" title="Parse handler for file version number." alt="" coords="203,207,500,225"/>
<area shape="rect" id="node9" href="simvoc.core.common_reader.CommonReader-class.html#in_clock_block" title="Returns: &#160;True iff at least one clock line has been parsed, allowing routines to &#160;ensure that the current command is inside a clock block" alt="" coords="203,225,500,244"/>
<area shape="rect" id="node9" href="simvoc.core.common_reader.CommonReader-class.html#parse" title="Main parser loop, invoked by the trigger() method." alt="" coords="203,244,500,263"/>
<area shape="rect" id="node9" href="simvoc.core.common_reader.CommonReader-class.html#scan" title="Implements the scanner portion of the common format reader." alt="" coords="203,263,500,281"/>
<area shape="rect" id="node9" href="simvoc.core.common_reader.CommonReader-class.html#warning" title="Uniform mechanism for raising a warning when conditions exist in the input &#160;file that do not necessarily constitute an error." alt="" coords="203,300,500,319"/>
<area shape="rect" id="node1" href="simvoc.core.common_reader.CommonReader-class.html" title="Implements a common scanner and parser for the simulator input formats written by simvoc.input.common_writer." alt="" coords="191,6,511,325"/>
<area shape="rect" id="node2" href="simvoc.core.map_format_reader.MapReader-class.html" title="Reader for dynamic grid map files, the textual format of which is documented externally." alt="" coords="5,345,221,383"/>
<area shape="rect" id="node3" href="simvoc.core.job_format_reader.JobReader-class.html" title="Mechanism for reading job trace files, creating Job objects from the traces, and submitting the resulting jobs to the grid." alt="" coords="251,345,453,383"/>
<area shape="rect" id="node4" href="simvoc.core.vo_format_reader.VOReader-class.html" title="Mechanism for reading Virtual Organization list files, which specify the VOs presently valid on the grid, along with the target and limit levels for VOCs dedicated to those VOs." alt="" coords="483,345,680,383"/>
</map>
  <img src="uml_class_diagram_for_simvoc_c_6.gif" alt='' usemap="#uml_class_diagram_for_simvoc_c_6" ismap="ismap" class="graph-without-title" />
</center>
</center>
<hr />
<p>Implements a common scanner and parser for the simulator input formats
  written by simvoc.input.common_writer. This base class handles basic file
  syntax checking, comment stripping, format number checking, clock lines, 
  and metadata. In addition, this implementation automatically schedules 
  the parsing of clock blocks at the appropriate times specified by the 
  clock lines. Subclasses will add parse handlers and extend the parser map
  to handle commands specific to different types of files.</p>
  <p>Errors and warnings delivered by this class and its subclasses will be
  in a format similar to those produced by gcc(1), containing the filename 
  and line number that triggers the error. In some cases, simulation errors
  may result from problems with the input data. Unfortunately, these types 
  of errors will not have source information.</p>

<!-- ==================== INSTANCE METHODS ==================== -->
<a name="section-InstanceMethods"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Instance Methods</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-InstanceMethods"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.common_reader.CommonReader-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">filename</span>,
        <span class="summary-sig-arg">fh</span>,
        <span class="summary-sig-arg">simobj</span>,
        <span class="summary-sig-arg">fmt_num</span>,
        <span class="summary-sig-arg">prefix</span>)</span><br />
      x.__init__(...) initializes x; see x.__class__.__doc__ for signature</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.common_reader-pysrc.html#CommonReader.__init__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.common_reader.CommonReader-class.html#add_handler" class="summary-sig-name">add_handler</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">cmd</span>,
        <span class="summary-sig-arg">handler</span>)</span><br />
      Adds a parse handler to support new commands.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.common_reader-pysrc.html#CommonReader.add_handler">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.common_reader.CommonReader-class.html#add_trigger" class="summary-sig-name">add_trigger</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">time</span>)</span><br />
      Adds a new parse trigger as a simulator event scheduled for a time 
      not in the past.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.common_reader-pysrc.html#CommonReader.add_trigger">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.common_reader.CommonReader-class.html#error" class="summary-sig-name">error</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">msg</span>)</span><br />
      Uniform mechanism for producing error messages (ReaderExceptions) 
      with filename and line number information.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.common_reader-pysrc.html#CommonReader.error">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">number</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.common_reader.CommonReader-class.html#get_epoch" class="summary-sig-name">get_epoch</a>(<span class="summary-sig-arg">self</span>)</span><br />
      Returns:
      epoch value found in the input file (defaults to zero if not present)</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.common_reader-pysrc.html#CommonReader.get_epoch">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.common_reader.CommonReader-class.html#h_clock" class="summary-sig-name">h_clock</a>(<span class="summary-sig-arg">self</span>)</span><br />
      Parse handler for clock lines.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.common_reader-pysrc.html#CommonReader.h_clock">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.common_reader.CommonReader-class.html#h_epoch" class="summary-sig-name">h_epoch</a>(<span class="summary-sig-arg">self</span>)</span><br />
      Parse handler for the epoch statement, which allows multiple input 
      files with normalized times to be used in the same simulation.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.common_reader-pysrc.html#CommonReader.h_epoch">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.common_reader.CommonReader-class.html#h_format" class="summary-sig-name">h_format</a>(<span class="summary-sig-arg">self</span>)</span><br />
      Parse handler for the &quot;format&quot; command.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.common_reader-pysrc.html#CommonReader.h_format">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.common_reader.CommonReader-class.html#h_meta" class="summary-sig-name">h_meta</a>(<span class="summary-sig-arg">self</span>)</span><br />
      Parse handler for metadata.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.common_reader-pysrc.html#CommonReader.h_meta">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.common_reader.CommonReader-class.html#h_version" class="summary-sig-name">h_version</a>(<span class="summary-sig-arg">self</span>)</span><br />
      Parse handler for file version number.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.common_reader-pysrc.html#CommonReader.h_version">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.common_reader.CommonReader-class.html#in_clock_block" class="summary-sig-name">in_clock_block</a>(<span class="summary-sig-arg">self</span>)</span><br />
      Returns:
      True iff at least one clock line has been parsed, allowing routines 
      to ensure that the current command is inside a clock block</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.common_reader-pysrc.html#CommonReader.in_clock_block">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.common_reader.CommonReader-class.html#parse" class="summary-sig-name">parse</a>(<span class="summary-sig-arg">self</span>)</span><br />
      Main parser loop, invoked by the trigger() method.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.common_reader-pysrc.html#CommonReader.parse">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">bool</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.common_reader.CommonReader-class.html#scan" class="summary-sig-name">scan</a>(<span class="summary-sig-arg">self</span>)</span><br />
      Implements the scanner portion of the common format reader.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.common_reader-pysrc.html#CommonReader.scan">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.common_reader.CommonReader-class.html#set_normalization" class="summary-sig-name">set_normalization</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">normtime</span>)</span><br />
      Sets the offset according to the specified normalized time value.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.common_reader-pysrc.html#CommonReader.set_normalization">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.common_reader.CommonReader-class.html#set_offset" class="summary-sig-name">set_offset</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">offset</span>)</span><br />
      Sets the clock block time offset, used in cases where multiple input 
      files with normalized times are used in the same simulation (see the 
      set_normalization() method).</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.common_reader-pysrc.html#CommonReader.set_offset">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.common_reader.CommonReader-class.html#trigger" class="summary-sig-name">trigger</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">time</span>,
        <span class="summary-sig-arg">simobj</span>)</span><br />
      Parse trigger: a simulator-aware function that invokes the parser to 
      handle the next clock block.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.common_reader-pysrc.html#CommonReader.trigger">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.common_reader.CommonReader-class.html#warning" class="summary-sig-name">warning</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">msg</span>)</span><br />
      Uniform mechanism for raising a warning when conditions exist in the 
      input file that do not necessarily constitute an error.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.common_reader-pysrc.html#CommonReader.warning">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
      <code>__delattr__</code>,
      <code>__format__</code>,
      <code>__getattribute__</code>,
      <code>__hash__</code>,
      <code>__new__</code>,
      <code>__reduce__</code>,
      <code>__reduce_ex__</code>,
      <code>__repr__</code>,
      <code>__setattr__</code>,
      <code>__sizeof__</code>,
      <code>__str__</code>,
      <code>__subclasshook__</code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== PROPERTIES ==================== -->
<a name="section-Properties"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Properties</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-Properties"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
      <code>__class__</code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== METHOD DETAILS ==================== -->
<a name="section-MethodDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Method Details</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-MethodDetails"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
</table>
<a name="__init__"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">filename</span>,
        <span class="sig-arg">fh</span>,
        <span class="sig-arg">simobj</span>,
        <span class="sig-arg">fmt_num</span>,
        <span class="sig-arg">prefix</span>)</span>
    <br /><em class="fname">(Constructor)</em>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.common_reader-pysrc.html#CommonReader.__init__">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>x.__init__(...) initializes x; see x.__class__.__doc__ for 
  signature</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>filename</code></strong> (str) - Name of the open input file</li>
        <li><strong class="pname"><code>fh</code></strong> - Handle to the open input file (r mode)</li>
        <li><strong class="pname"><code>simobj</code></strong> - Reference to the simulator object</li>
        <li><strong class="pname"><code>fmt_num</code></strong> (float) - Format number of the input file, to be checked against any 
          &quot;format&quot; commands inside the file. When formats do not 
          match, a warning will be generated.</li>
        <li><strong class="pname"><code>prefix</code></strong> (str) - Prefix to add to metadata fields when creating metadata results 
          for the simulator</li>
    </ul></dd>
    <dt>Overrides:
        object.__init__
    </dt>
  </dl>
</td></tr></table>
</div>
<a name="add_handler"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">add_handler</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">cmd</span>,
        <span class="sig-arg">handler</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.common_reader-pysrc.html#CommonReader.add_handler">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Adds a parse handler to support new commands. This method is used by 
  subclasses to extend the parser.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>cmd</code></strong> (str) - Command to handle</li>
        <li><strong class="pname"><code>handler</code></strong> - Handler method to invoke when the command is seen</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="add_trigger"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">add_trigger</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">time</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.common_reader-pysrc.html#CommonReader.add_trigger">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Adds a new parse trigger as a simulator event scheduled for a time not
  in the past. Only one trigger event may be active at a time: adding a 
  second trigger will result in an Exception being raised.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>time</code></strong> (number) - Time at which the parse trigger will be invoked, subject to 
          automatic offset</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="error"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">error</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">msg</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.common_reader-pysrc.html#CommonReader.error">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Uniform mechanism for producing error messages (ReaderExceptions) with
  filename and line number information. This method automatically adds the 
  location information, so the error message passed to this method should 
  be &quot;plain&quot; (without filename or line number).</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>msg</code></strong> (str) - Error message to include</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="get_epoch"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">get_epoch</span>(<span class="sig-arg">self</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.common_reader-pysrc.html#CommonReader.get_epoch">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  
  <dl class="fields">
    <dt>Returns: number</dt>
        <dd>epoch value found in the input file (defaults to zero if not 
          present)</dd>
  </dl>
</td></tr></table>
</div>
<a name="h_clock"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">h_clock</span>(<span class="sig-arg">self</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.common_reader-pysrc.html#CommonReader.h_clock">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Parse handler for clock lines. Upon reading a clock line, this handler
  will schedule a trigger() method invocation for the time specified by the
  clock line.</p>
  <dl class="fields">
    <dt>Returns:</dt>
        <dd>False</dd>
  </dl>
</td></tr></table>
</div>
<a name="h_epoch"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">h_epoch</span>(<span class="sig-arg">self</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.common_reader-pysrc.html#CommonReader.h_epoch">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Parse handler for the epoch statement, which allows multiple input 
  files with normalized times to be used in the same simulation. An epoch 
  statement may only occur once in the file, and it must occur before the 
  first clock line.</p>
  <dl class="fields">
    <dt>Returns:</dt>
        <dd>True</dd>
  </dl>
</td></tr></table>
</div>
<a name="h_format"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">h_format</span>(<span class="sig-arg">self</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.common_reader-pysrc.html#CommonReader.h_format">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Parse handler for the &quot;format&quot; command. Raises a warning if 
  the format of the input file does not match the format number set in the 
  constructor.</p>
  <dl class="fields">
    <dt>Returns:</dt>
        <dd>True</dd>
  </dl>
</td></tr></table>
</div>
<a name="h_meta"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">h_meta</span>(<span class="sig-arg">self</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.common_reader-pysrc.html#CommonReader.h_meta">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Parse handler for metadata. Each metadata item is added to the 
  instance metadata dictionary (self.metadata).</p>
  <dl class="fields">
    <dt>Returns:</dt>
        <dd>True</dd>
  </dl>
</td></tr></table>
</div>
<a name="h_version"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">h_version</span>(<span class="sig-arg">self</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.common_reader-pysrc.html#CommonReader.h_version">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Parse handler for file version number.</p>
  <dl class="fields">
    <dt>Returns:</dt>
        <dd>True</dd>
  </dl>
</td></tr></table>
</div>
<a name="in_clock_block"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">in_clock_block</span>(<span class="sig-arg">self</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.common_reader-pysrc.html#CommonReader.in_clock_block">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  
  <dl class="fields">
    <dt>Returns:</dt>
        <dd>True iff at least one clock line has been parsed, allowing 
          routines to ensure that the current command is inside a clock 
          block</dd>
  </dl>
</td></tr></table>
</div>
<a name="parse"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">parse</span>(<span class="sig-arg">self</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.common_reader-pysrc.html#CommonReader.parse">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Main parser loop, invoked by the trigger() method. The parser loop 
  runs, invoking the scanner and parse handlers as needed, until a parse 
  handler returns False or EOF is reached. In general, only h_clock() ever 
  returns False, to indicate that parsing of the current clock block is 
  complete.</p>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="scan"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">scan</span>(<span class="sig-arg">self</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.common_reader-pysrc.html#CommonReader.scan">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Implements the scanner portion of the common format reader. This 
  method is invoked automatically by the parse() method and sets the 
  current scan line (self.line) and token list (self.parts).</p>
  <dl class="fields">
    <dt>Returns: bool</dt>
        <dd>True if there is more data in the input file, False if the reader
          has reached EOF</dd>
  </dl>
</td></tr></table>
</div>
<a name="set_normalization"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">set_normalization</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">normtime</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.common_reader-pysrc.html#CommonReader.set_normalization">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Sets the offset according to the specified normalized time value. This
  time value must be the lowest epoch from all data sets, otherwise a 
  simulation-time Exception will occur.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>normtime</code></strong> (number) - Earliest timestamp among all data sets</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="set_offset"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">set_offset</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">offset</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.common_reader-pysrc.html#CommonReader.set_offset">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Sets the clock block time offset, used in cases where multiple input 
  files with normalized times are used in the same simulation (see the 
  set_normalization() method).</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>offset</code></strong> (number) - New offset value</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="trigger"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">trigger</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">time</span>,
        <span class="sig-arg">simobj</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.common_reader-pysrc.html#CommonReader.trigger">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Parse trigger: a simulator-aware function that invokes the parser to 
  handle the next clock block.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>time</code></strong> (number) - Current simulated time</li>
        <li><strong class="pname"><code>simobj</code></strong> - Reference to the simulator object</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="warning"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">warning</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">msg</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.common_reader-pysrc.html#CommonReader.warning">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Uniform mechanism for raising a warning when conditions exist in the 
  input file that do not necessarily constitute an error. Location 
  information (filename and line number) are added automatically.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>msg</code></strong> (str) - Warning message to include</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="simvoc-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            >SimVOC</th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0 on Fri Oct 23 11:04:29 2009
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
